An encoding system called high efficiency video coding (HEVC) has been standardized by joint collaboration team-video coding (JCTVC) corresponding to a joint standardizing body of ITU-T and ISO/IEC (for example, see Non-Patent Document 1).
According to advanced video coding (AVC) system and HEVC system, motion vectors with fractional pixel accuracy (decimal pixel accuracy) are detected in respective prediction directions for bidirectional prediction (BiP) of an 8-bit image. Motion compensation is performed on the basis of the detected motion vectors. Further, according to the AVC system, 14-bit predicted images obtained in respective prediction directions are rounded into 8-bit images, and averaged to form final predicted images.
According to the HEVC system, however, 14-bit predicted images in respective prediction directions are not rounded. The 14-bit predicted images not rounded are averaged to form final predicted images. Accordingly, accuracy of the predicted images improves in comparison with accuracy of the predicted images formed by the AVC system. However, the HEVC system increases a storage capacity of a cache necessary for retaining predicted images in respective prediction directions before averaging. The same holds when a prediction mode is a merge mode.
Moreover, in case of bidirectional prediction, reference images in two directions need to be retained in the cache for detection of motion vectors and motion compensation. Accordingly, the storage capacity of the cache necessary for retaining reference images becomes larger than the corresponding storage capacity for unidirectional prediction.